import { Alova } from '@/utils/http/alova/index';
import { Config } from '../config';

export interface NetWork {
  name: string;
  id: number;
  ip: string;
  nwMask: string;
  gateway: string;
  dnsServer: string;
}

// 获取网络参数
export function getNetWorkInfo() {
  return Alova.Get<Config>('/config', {
    meta: {
      isReturnNativeResponse: true, // 关键配置, 返回原生响应头
    },
  });
}

// 更新网络参数
export function updateNetWorkInfo(data: NetWork) {
  return Alova.Post<string>('/config', data, {
    meta: {
      isReturnNativeResponse: true, // 关键配置, 返回原生响应头
    },
  });
}
